<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('资产记录列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="record-form">
                <div class="select-list">
                    <ul>
                        <li>
                            <input type="text" name="assetId" th:value="${assetId}" hidden/>
                        </li>
                        <li>
                            操作类型：<select name="operateType" th:with="type=${@dict.getType('oa_asset_operate_type')}">
                            <option value="">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">

    var assetOperateTypes = [[${@dict.getType('oa_asset_operate_type')}]];

    var prefix = ctx + "oa/asset/operate";

    $(function () {
        var options = {
            url: prefix + "/list",
//                createUrl: prefix + "/add",
//                updateUrl: prefix + "/edit/{id}",
//                removeUrl: prefix + "/remove",
            modalName: "资产",
            showColumns: true,
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'operateType',
                    title: '操作类型',
                    align: 'center',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(assetOperateTypes, value);
                    }
                },
                {
                    field: 'operateNum',
                    title: '操作数量'
                },
                {
                    field: 'operateDate',
                    title: '操作时间'
                },

                {
                    field: 'abradeRate',
                    title: '折损率'
                },
                {
                    field: 'operateUserId',
                    title: '操作人'
                }
            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>